from django.db import models


class TableAppAd(models.Model):
    """ 广告检测表 """
    # id = models.AutoField(primary_key=True)
    create_time = models.DateTimeField(auto_now_add=True)
    app_id = models.IntegerField()
    campaign = models.CharField(max_length=32)
    geo = models.CharField(max_length=32)
    site = models.CharField(max_length=128)
    spot = models.CharField(max_length=32)
    banner = models.CharField(max_length=32)
    ad_id = models.IntegerField()
    bid = models.IntegerField()
    ip = models.CharField(max_length=16)

    class Meta:
        db_table = 'cmf_app_ad'

    def __str__(self):
        return f'{self.app_id}_{self.campaign}_{self.ad_id}'
